package com.jingwu.example.remote;

import cn.hutool.core.util.RandomUtil;
import com.jingwu.example.enums.Status;
import com.jingwu.example.pojo.entity.BarDO;
import org.springframework.stereotype.Component;

/**
 * @author 菁芜
 * @since 2021/1/3 -16:19
 */
@Component
public class DummyRemoteClient {

    public BarDO getByFooId(String fooId) {
        // 实际应当远程调用获取数据
        return getBarDO(fooId);
    }

    private BarDO getBarDO(String fooId) {
        BarDO barDO = new BarDO();
        barDO.setFooId(fooId);
        barDO.setId(RandomUtil.randomString(20));
        barDO.setType(RandomUtil.randomEle(Status.values()));
        return barDO;
    }

}
